"use strict";
var emps = [
    { id: 1, name: "小王", age: 23, address: "成都" },
    { id: 2, name: "小张", age: 24, address: "武汉" },
    { id: 3, name: "小吴", age: 22, address: "北京" }
];
function getMaxAagEmp(emps) {
    var temp = emps.map(function (item) {
        return item.age;
    });
    //Math.max获取一堆数据最大值 Math.max(...temp)
    var maxAge = Math.max.apply(emps, temp);
    var emp = emps.find(function (item) { return item.age == maxAge; });
    return emp;
}
function searchByName(emps, key) {
    var temp = emps.filter(function (item) {
        if (item.name.indexOf(key) != -1) {
            return true;
        }
    });
    return temp;
}
function orderByAes(emps) {
    emps.sort(function (a, b) {
        return a.age - b.age;
    });
    return emps;
}
